<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'profile-form',
    'enableClientValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => false,
    ),
    'htmlOptions' => array(
        'class' => 'form-horizontal',
        'enctype' => 'multipart/form-data',
    )
        ));
?>
<fieldset>
    <div class="control-group">
        <label class="control-label" for="typeahead"><?php echo Yii::t("main", "Họ tên"); ?></label>
        <div class="controls">
            <?php echo $form->textField($model, 'full_name', array('placeholder' => Yii::t('main', 'Họ tên (bắt buột)'), 'class' => 'input-large span10')); ?>
            <?php echo $form->error($model, 'full_name'); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="typeahead"><?php echo Yii::t("main", "Địa chỉ"); ?></label>
        <div class="controls">
            <?php echo $form->textField($model, 'address', array('placeholder' => Yii::t('main', 'Địa chỉ (không bắt buột)'), 'class' => 'input-large span10')); ?>
            <?php echo $form->error($model, 'address'); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="typeahead"><?php echo Yii::t("main", "Điện thoại"); ?></label>
        <div class="controls">
            <?php echo $form->textField($model, 'phone', array('placeholder' => Yii::t('main', 'Điện thoại (không bắt buột)'), 'class' => 'input-large span10')); ?>
            <?php echo $form->error($model, 'phone'); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="typeahead"><?php echo Yii::t("main", "Hình ảnh"); ?></label>
        <div class="controls">
            <?php $str_img = $this->current_user->getAvatar() ?>
            <script type="text/javascript">
                var img = '<?php echo $str_img; ?>';
            </script>
            <img id="img_avatar" src="<?php echo $str_img ?>" style="margin-bottom: 5px;width: 128px; height: 128px" />
            <br />
            <?php echo $form->fileField($model, 'avatar'); ?>
            <?php echo $form->error($model, 'avatar'); ?>
        </div>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn-large btn-primary"><?php echo Yii::t("main", "Lưu"); ?></button>
        <button type="reset" class="btn btn-large"><?php echo Yii::t("main", "Hủy bỏ"); ?></button>
    </div>
</fieldset> 
<?php $this->endWidget(); ?>